package cn.anzhiyublog.staranimegallery.model.enums;

import lombok.Getter;

/**
 * 空间等级
 *
 * @author 安知一只鱼
 */
@Getter
public enum SpaceLevel {
    /*
        0 普通 100mb 100个、
        1 专业 500mb 500个
    */
    NORMAL(0, "普通版", 100L*1024*1024, 100),
    PROFESSIONAL(1, "专业版", 500L*1024*1024, 500);

    private final int level;
    private final String name;
    private final long maxCapacity;
    private final long maxCount;

    SpaceLevel(int level, String name, long maxCapacity, long maxCount) {
        this.level = level;
        this.name = name;
        this.maxCapacity = maxCapacity;
        this.maxCount = maxCount;
    }

    public static SpaceLevel getEnumByLevel(int level) {
        for (SpaceLevel spaceLevel : SpaceLevel.values()) {
            if (spaceLevel.level == level) {
                return spaceLevel;
            }
        }
        return null;
    }
}
